package com.tacademy.android.lbs;

import org.restlet.Application;
import org.restlet.Context;
import org.restlet.Restlet;
import org.restlet.routing.Router;

import com.tacademy.android.lbs.friend.FriendRestlet;
import com.tacademy.android.lbs.friend.MyLocationRestlet;
import com.tacademy.android.lbs.location.LocationRestlet;
import com.tacademy.android.lbs.location.VisitRestlet;

public class LocationApplication extends Application {
	
	public LocationApplication(Context parentContext) {
		super(parentContext);
	}
	
	/**
	 * Creates a root Restlet that will receive all incoming calls.
	 */
	@Override
	public Restlet createInboundRoot() {
		// Create a root router
		Router router = new Router(getContext());
		
		// Attach the handlers to the root router
		// router.attach("/service/location", LocationRestlet.class);
		// router.attach("/service/location/{location_id}", LocationRestlet.class);
		// router.attach("/service/visit", VisitRestlet.class);
		router.attach("/service/friend", FriendRestlet.class);
		router.attach("/service/friend/{friend_id}", FriendRestlet.class);
		router.attach("/service/myLocation", MyLocationRestlet.class);
		
		// Return the root router
		return router;
	}

}
